home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Extension Link Problem < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  2.2 KB  |  [TEXT/ttxt]

  1. Subject:     Extension Link Problem
  2. Sent:        6/7/96 7:19 AM
  3. Received:    6/7/96 8:51 AM
  4. From:        Doyle Rhynard, doyle.w.rhynard@cpmx.saic.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8.     I am having a problem with linking a client part when I reference an
  9. extension defined in another part. This the IDL file that I am using to
  10. define the extension, TestExt:
  11.  
  12.   #ifndef TestExt_IDL
  13.     #define TestExt_IDL
  14.  
  15.     #include "Extensn.idl"
  16.  
  17.     interface TestExt;
  18.  
  19.     module ADI {
  20.       interface TestExt: ODExtension {
  21.         void  InitTestExt(in ODObject base, in long initialID);
  22.         long  GetX();
  23.         void  SetX(in long Y);
  24.         void  Run();
  25.  
  26.         #ifdef __SOMIDL__
  27.           implementation {
  28.             majorversion = 1; minorversion = 0;
  29.             long  x;
  30.  
  31.             releaseorder:
  32.               InitTestExt,
  33.               GetX,
  34.               SetX,
  35.               Run;
  36.           };
  37.         #endif
  38.       };
  39.     };
  40.  
  41.   #endif
  42.  
  43.  
  44. I have added the method, RunTest, to the client ODFContainer derived part:
  45.  
  46.   void CADISimPart::RunTest(Environment *ev) {
  47.     int  NumProxies = fPartContent->CountProxies();
  48.     CContentProxyIterator  ite(fPartContent);
  49.  
  50.     for (CProxy* proxy = ite.First(); ite.IsNotComplete(); proxy = ite.Next()) {
  51.       ODPart*  partTest = proxy->AcquireEmbeddedPart(ev);
  52.       FW_Boolean  extODExists = partTest->HasExtension(ev, "TestExt");
  53.       if (extODExists) {
  54.         ODExtension*  extPartOD = partTest->AcquireExtension(ev, "TestExt");
  55.         ((ADI_TestExt*)extPartOD)->Run(ev);
  56.       }
  57.     }
  58.   }
  59.  
  60.  
  61. Everything compiles without any problems. However, when I try to link the
  62. client part, I keep gettin the link error:
  63.  
  64.            Link Error   : undefined 'ADI_TestExtClassData' (data)
  65.            Referenced from 'CADISimPart::RunTest(Environment*)' in Part.cpp
  66.  
  67.  
  68.     Can anyone venture a guess as what I am doing wrong. I have working on
  69. getting a simple extension to work for more than a week, now. Without any
  70. complete working examples to guide me, I feel that I am just fumbling
  71. around in the dark trying to piece together what I need to do from the
  72. little concrete information that is available.
  73.  
  74. Doyle Rhynard
  75.  
  76.